//
//  CurriculumAllEvaCell.m
//  优学荟管理系统
//
//  Created by 星道 on 17/7/20.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "CurriculumAllEvaCell.h"

@implementation CurriculumAllEvaCell
{
    IBOutlet UILabel *_ID;
    IBOutlet UILabel *_Name;
    IBOutlet UIButton *_Select;
    __weak IBOutlet UILabel *_totalEvaNum;
    __weak IBOutlet UILabel *_WeiWanCheng;
}

/**
 选择
 */
- (IBAction)ClickSelct:(UIButton *)sender {

    self.ClickSelect(sender);
}




- (instancetype (^)(ZYCourseAttendanceTowModel *))Model {

    return ^(ZYCourseAttendanceTowModel *Model) {

        _Name.text = Model.user_petName ? [NSString stringWithFormat:@"%@",Model.user_petName]:[NSString stringWithFormat:@"%@",Model.user_username];
        _ID.text = [NSString stringWithFormat:@"%@/%@",[Model.commentCount stringValue], [Model.courseCount stringValue]];
        _totalEvaNum.text = [Model.todayCommentCount stringValue];
        //2已签到 设为选中 1未签到，设为未选中
        _Select.selected = [Model.isSign isEqualToNumber:@1]?NO:YES;
        _Select.hidden = [Model.commentCount integerValue] >= [Model.courseCount integerValue] ? YES : NO;
        _WeiWanCheng.hidden = [Model.type isEqualToNumber:@0] ? YES:NO;
        // 是不是能够使用
        _Select.enabled = Model.Enable;
        return self;
    };
}
@end
